//package net.rain.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.config.http.SessionCreationPolicy;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
///**
// * @author Rainy-Heights
// * @version 1.0
// * @Date 2023/7/16 1:27
// */
//@Configuration
//@EnableGlobalMethodSecurity(prePostEnabled = true)//开启权限配置
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
//    @Bean
//    public PasswordEncoder encoder(){
//        return new BCryptPasswordEncoder();
//    }
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http
//                .csrf().disable()
//                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
//                .and().authorizeRequests()
//                .antMatchers("/auth/login","/static/**","/api/**",
//                "/js/**","/favicon.ico","/page/**","/resources/**",
//                        "/styles/**","/images/**","/plugins/**"
//                ).permitAll()
//                .anyRequest().authenticated();
//
//        http.cors();
//
////        http.formLogin().loginPage("/page/login/login.html")
////                .defaultSuccessUrl("/index.html",true)
////                .successForwardUrl("/index.html")
////                .permitAll();
//    }
//    @Bean
//    @Override
//    public AuthenticationManager authenticationManager() throws Exception{
//        return super.authenticationManager();
//    }
//}
